package com.example.testinfocollect;

import com.starnet.infocollecter.InfoCollecter;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;

public class MainActivity extends Activity
{

	private InfoCollecter infoCollecter;
	@Override
	protected void onCreate(Bundle savedInstanceState) 
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		TextView textView = (TextView) findViewById(R.id.textView);
		SingleTool.textView = textView;
		
		infoCollecter = new InfoCollecter();
		infoCollecter.init(this, "http://172.18.7.29:8080/mobileMsgService/mobileservice", "admin", "ruijie2014");
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	
	@Override
	protected void onDestroy() 
	{
		super.onDestroy();
		if(infoCollecter != null)
		{
			infoCollecter.onDestroy();
		}
	}

}
